import request from '../utils/request'
enum Api {
  GetMvList = '/mv/all',
  GetMvTopList = `/top/mv`,
  GetMvPlay = `/mv/url`,
  GetFirstMv = `/mv/first`,
  GetCategoryList = `/video/category/list`,
  GetGroupMv = `/video/group`,
}

/**
 * 获取mv视频列表
 * @returns
 */
export const getMvListApi = () => {
  return request({
    url: Api.GetMvList,
    method: 'GET',
  })
}

/**
 * 获取排行榜列表
 * @param limit 获取的排行榜条数
 * @returns
 */
export const getMvTopListApi = (limit: number) => {
  return request({
    url: Api.GetMvTopList,
    method: 'get',
    params: { limit },
  })
}

/**
 * 获取mv播放列表
 * @param id mvID
 * @returns
 */
export const getMvPlayApi = (id: number) => {
  return request({
    url: Api.GetMvPlay,
    method: 'get',
    params: { id },
  })
}

/**
 * 获取最新Mv列表
 * @param limit 获取的最新Mv列表条数
 * @returns
 */
export const getFirstMvApi = (limit: number) => {
  return request({
    url: Api.GetFirstMv,
    method: 'get',
    params: { limit },
  })
}

/**
 * 获取mv视频分类列表
 * @returns
 */
export const getCategoryListApi = () => {
  return request({
    url: Api.GetCategoryList,
    method: 'GET',
  })
}

/**
 * 获取分类视频
 * @param id 分类Id
 * @returns
 */
export const getGroupMvApi = (id: number) => {
  return request({
    url: Api.GetGroupMv,
    method: 'get',
    params: { id },
  })
}
